package de.karlNet.executor.scanner.io;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class AppWriter {
	private Writer writer;

	public AppWriter() {
		File file = new File("/Applications/installedApps");
		try {
			file.createNewFile();
			this.writer = new BufferedWriter(new FileWriter(
					"/Applications/installedApps"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public void writeEntry(String name, String path) {
		try {
			this.writer.write(name + "=" + path + "\n");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public void close() {
		try {
			this.writer.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
